//吕洞宾
public class Lvdong {
    String name, sex;

    public Lvdong(String name, String sex) {
        this.name = name;
        this.sex = sex;
    }
}
//刺猬
public class Ciwei {
    String name;

    public Ciwei(String name) {
        this.name = name;
    }
}
//狗
public class Dog {
    String name;

    public Dog(String name) {
        this.name = name;
    }

    public void bite(Lvdong a) {
        System.out.println("狗咬" + a.name + ",不识好人心！");
    }

    public void bite(Dog b) {
        System.out.println("狗咬" + b.name + "，一嘴毛");
    }

    public void bite(Ciwei c) {
        System.out.println("狗咬" + c.name + ",无从下口");
    }
}
//4：用oop的思想模拟 狗咬吕洞宾,不识好人心；
//狗咬刺猬，无从下口；狗咬狗，一嘴毛.相关类用构造方法初始化属性（方法都是咬，bite)
//狗有名字的属性，刺猬有名字的属性，好人有名字和性别属性
public class Oopzy02 {
    public static void main(String[] args) {
        Dog d = new Dog("狗");
        Ciwei ci = new Ciwei("刺猬");
        Lvdong lv = new Lvdong("吕洞宾", "男");
        d.bite(lv);
        d.bite(ci);
        d.bite(d);
    }
}